#include "StimNDotSolid.h"


CStimNDotSolid::CStimNDotSolid(const bool& bAlsoCeiling_)
    :
CStimNDot(bAlsoCeiling_? Stims::GroundCeiling : Stims::Ground) // set world type
{
}

CStimNDotSolid::~CStimNDotSolid(void)
{
}


void CStimNDotSolid::Reset()
{
    // first call base
    CStimNDot::Reset();

    // init ground plane
    glNewList(_uDisplay,GL_COMPILE);

    glColor3dv(&_vGroundColor[0]);
    glBegin(GL_QUADS);
        glVertex3d(_dXRangeMin, -_dEyeHeight, _dZRangeMax);
        glVertex3d(_dXRangeMax, -_dEyeHeight, _dZRangeMax);
        glVertex3d(_dXRangeMax, -_dEyeHeight, _dZRangeMin);
        glVertex3d(_dXRangeMin, -_dEyeHeight, _dZRangeMin);
    glEnd();
    if (_eStimType==Stims::GroundCeiling)
    {
        glBegin(GL_QUADS);
            glVertex3d(_dXRangeMin, _dEyeHeight, _dZRangeMin);
            glVertex3d(_dXRangeMax, _dEyeHeight, _dZRangeMin);
            glVertex3d(_dXRangeMax, _dEyeHeight, _dZRangeMax);
            glVertex3d(_dXRangeMin, _dEyeHeight, _dZRangeMax);
        glEnd();
    }

    glEndList();
}

std::string CStimNDotSolid::GetName()
{
    if (_eStimType==Stims::GroundCeiling)
        return std::string("Ground & Ceiling, empty");
    else
        return std::string("Ground, empty");
}